package com.kuhyygy.widget;

import com.kuhyygy.R;

import android.content.res.Resources;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class LifeTabWidget extends FragmentActivity {

	private TabHost mTabHost;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		Resources res = getResources();
		setContentView(R.layout.v4lifetab);
		mTabHost = (TabHost) findViewById(android.R.id.tabhost);
		mTabHost.setup();

		TabSpec musicTs = mTabHost.newTabSpec("Music")
				.setIndicator("Music", res.getDrawable(R.drawable.ic_tab_life))	// label跟图片不能同时显示,要做些修改才可以
				.setContent(R.id.musicFrag);
		mTabHost.addTab(musicTs);
		
		TabSpec photoTs = mTabHost.newTabSpec("Photo")
				.setIndicator("Photo", res.getDrawable(R.drawable.ic_tab_life))
				.setContent(R.id.photoFrag);
		mTabHost.addTab(photoTs);
		
		TabSpec videoTs = mTabHost.newTabSpec("video")
				.setIndicator("video", res.getDrawable(R.drawable.ic_tab_life))
				.setContent(R.id.videoFrag);
		mTabHost.addTab(videoTs);
		
		mTabHost.setScrollContainer(true);
		mTabHost.setCurrentTab(0);
		
	}
	
}
